Prevent local absolute paths from being entered in App config#2814
Merged
pipecd-bot merged 3 commits intomasterfrom Nov 19, 2021
Merged
Prevent local absolute paths from being entered in App config#2814pipecd-bot merged 3 commits intomasterfrom
pipecd-bot merged 3 commits intomasterfrom
Conversation
Collaborator
nghialv
reviewed
Nov 19, 2021
Collaborator
|
Code coverage for golang is
|
nghialv
reviewed
Nov 19, 2021
|
|
||
| func (r *Reporter) readApplicationInfo(ctx context.Context, cfgFilePath string) (*model.ApplicationInfo, error) { | ||
| b, err := fs.ReadFile(r.fileSystem, cfgFilePath) | ||
| func (r *Reporter) readApplicationInfo(appPath, cfgFileAbsPath string) (*model.ApplicationInfo, error) { |
Member
There was a problem hiding this comment.
Sorry, it should be repoDir, appDirRelPath, cfgFilename
Member
There was a problem hiding this comment.
I mean we should use the same thing in our code and data in db, they are appPath and cfgFilename, and repoDir is added for dealing with the local file system.
Co-authored-by: Le Van Nghia <nghialv2607@gmail.com>
Member
Author
|
@nghialv Applied! PTAL |
Member
|
Looks nice. |
Collaborator
|
Code coverage for golang is
|
Member
|
Nice |
Collaborator
This was referenced Dec 1, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This PR solves the problem where Piped would specify a local absolute path as GitPath when reporting a Git-defined Config to Control-plane.
Which issue(s) this PR fixes:
Close #2806
Does this PR introduce a user-facing change?: